[#import "/framework/JGP.htm"  as JGP]
<!--
项目   jgp-cloud-parent
作者   LOUFEI [Gavin]
时间   2019/1/5
-->
[@JGP.head "任务处理"/]
[@JGP.body]
    <jgp-form slot="1-1" _disabled="${editFlag?string('false','true')}">
        <jgp-form-group _title="处理意见">
            <jgp-area _id="remark"
                      _col="12"
                      _row="6"
                      _disabled="${editFlag?string('false','true')}"
                      _value="[#if comments??][#list comments as comment]${comment.time?datetime('yyyy-MM-dd hh:mm')?substring(0,16)} ${comment.comment} ；[/#list][/#if]">
            </jgp-area>
        </jgp-form-group>
        <jgp-form-group>
            <jgp-btn _fn="checkOk" _disabled="${editFlag?string('false','true')}">同意</jgp-btn>
            <jgp-btn _fn="checkNo" _disabled="${editFlag?string('false','true')}">不同意</jgp-btn>
        </jgp-form-group>
    </jgp-form>
[/@JGP.body]

[@JGP.foot]
    <script>
        function checkOk() {
            var remark = JGP.area('remark').val();
            var jsonVariables = {
                flag: 1
            };
            new JGP.Task().passWithVar('${userId!''}', '${procId!''}', '${taskId!''}', remark, jsonVariables, function () {
                JGP.$close();
            })
        }

        function checkNo() {
            var remark = JGP.area('remark').val();
            JGP.$post('/workflow/processApiController/back', {
                userId: '${userId!''}',
                procId: '${procId!''}',
                taskId: '${taskId!''}',
                remark: remark,
            }, function () {
                JGP.$close();
            })
        }
    </script>
[/@JGP.foot]